package com.example.entity;

import com.example.common.DataStatus;
import com.example.common.WorkType;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class nullWeightRecord implements Serializable {


    private Long id;
    private String weighbridgeName;

    private String licensePlate;
    @ApiModelProperty
    private WorkType workType;

    private Integer weight;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date weighingTime; // 创建时间

    private Long grossWeightId;
    @ApiModelProperty
    private DataStatus dataStatus;


    @PrePersist
    protected void onCreate() {
        weighingTime = new Date();
    }
}